@page "/counter"
@inject HttpClient Http

<h1>Counter</h1>

<p>Current count: @currentCount</p>

<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>

<p>Message: @message</p>

<button class="btn btn-primary" @onclick="GetMessage">Salutation</button>

@code {
    private int currentCount = 0;
    private string message = "Hi!";

    private  async Task  GetMessage(){
        var temp =  await Http.GetStringAsync("/api/JustHello?name=cloudies");
        message = temp;
    }

    private void IncrementCount()
    {
        currentCount++;
    }
}